from tortoise.contrib.fastapi import register_tortoise
from settings.db_config import *
from fastapi import FastAPI


async def register_mysql(app: FastAPI):
    # 注册数据库
    register_tortoise(
        app,
        config=DB_ORM_CONFIG,
        generate_schemas=True,
        add_exception_handlers=False,
    )
